/*
 * @Author: 2112778581 2112778581@qq.com
 * @Date: 2023-10-16 17:41:54
 * @LastEditors: asanupup 15465106+asanupup@user.noreply.gitee.com
 * @LastEditTime: 2025-08-05 10:14:38
 * @FilePath: \pra\src\app.module.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { UserModule } from './user/user.module';
import { UploaderModule } from './uploader/uploader.module';
import { DbModule } from '@libs/db';
import { ScheduleModule } from '@nestjs/schedule';
import { ConfigModule } from '@nestjs/config';
import { AuthModule } from './auth/auth.module';
import { JwtAuthGuard } from './auth/jwt-auth.guard';
import { JwtModule } from '@nestjs/jwt';
import { MenuModule } from './menu/menu.module';
import { RolesController } from './roles/roles.controller';
import { RolesModule } from './roles/roles.module';
import { getConfig } from '../utils/index';
import { CategoryModule } from './category/category.module';
import { ListDetailModule } from './list-detail/list-detail.module';
import { StatisticsModule } from './statistics/statistics.module';
import { AttemptCustomerModule } from './attempt-customer/attempt-customer.module';
import { ConfigurationModule } from './configuration/configuration.module';
import { EmailModule } from './email/email.module';
import { HandpicDeviceModule } from './handpic-device/handpic-device.module';
import { WebbaseModule } from './webbase/webbase.module';
import { WebmenusModule } from './webmenus/webmenus.module';
import { CarouselModule } from './carousel/carousel.module';
import { DynamicFormModule } from './dynamic-form/dynamic-form.module';

@Module({
  imports: [
    UserModule,
    UploaderModule,
    DbModule,
    JwtModule,
    ScheduleModule.forRoot(),
    ConfigModule.forRoot({
      ignoreEnvFile: true,
      isGlobal: true, // 设置为全局
      load: [getConfig],
    }),
    AuthModule,
    MenuModule,
    RolesModule,
    CategoryModule,
    ListDetailModule,
    StatisticsModule,
    AttemptCustomerModule,
    ConfigurationModule,
    EmailModule,
    HandpicDeviceModule,
    WebbaseModule,
    WebmenusModule,
    CarouselModule,
    DynamicFormModule
  ],
  controllers: [AppController, RolesController],
  providers: [
    AppService,
    {
      provide: 'APP_GUARD',
      useClass: JwtAuthGuard,
    },
  ],
})
export class AppModule {}
